Logo
Spacer News Wiki Features F.A.Q. Team members Screenshots Download Messageboard Bug tracker Submit files
Top divider

Lua UnsyncedCtrl

Contents

[edit] Pipes

Spring.Echo

 ( arg1 [, arg2 [, ... ] ] ) -> nil
 Usefull for debugging.
Prints values in the spring chat console (hint: the default print() writes to STDIN).

Spring.PlaySoundFile

 ( string "soundfile" [, number volume
   [, number x, number y, number z ] ] ) -> nil | boolean
 Plays WAV sounds. By default, the soundfile is expected to be in the "Sounds" folder.

Spring.PlaySoundStream

 ( string "oggfile" [, number volume = 1.0
   [, number x, number y, number z ]] ) -> nil | boolean true
 Allow you to play an Ogg Vorbis (.OGG) compressed sound file.
Note: you may only play _ONE_ stream at a time. If another stream is playing and
you try to start a second one the call will fail, and silence will result.

Spring.StopSoundStream

 ( ) -> nil
 Terminates any SoundStream is running.
Since only one may play at any time (see above), this can be used as an interrupt.

[edit] SendMessage

Spring.SendMessage

 ( string "message" ) -> nil

Spring.SendMessageToPlayer

 ( number playerID, string "message" ) -> nil

Spring.SendMessageToTeam

 ( number teamID, string "message" ) -> nil

Spring.SendMessageToAllyTeam

 ( number allyID, string "message" ) -> nil

Spring.SendMessageToSpectators

 ( string "message" ) -> nil

[edit] Unit Selection

Spring.SelectUnitMap

 ( { [unitID] = anything, ...} [,boolean append] ) -> nil

Spring.SelectUnitArray

 ( { [1] = unitID1 , [2] = unitID2 , ...} [,boolean append] ) -> nil

[edit] Unit Control

Spring.SetUnitNoDraw LuaGadgets only!

 ( number unitID, boolean noDraw ) -> nil

Spring.SetUnitNoSelect LuaGadgets only!

 ( number unitID, boolean noSelect ) -> nil

Spring.SetUnitNoMinimap LuaGadgets only!

 ( number unitID, boolean noMinimap ) -> nil

[edit] GUI

Spring.SetDrawSky

 ( boolean drawSky ) -> nil

Spring.SetDrawWater

 ( boolean drawWater ) -> nil

Spring.SetDrawGround

 ( boolean drawGround ) -> nil

Spring.DrawUnitCommands

 ( number unitID ) -> nil
 ( { [1] = unitID, ... } [, false ] ) -> nil
 ( { [unitID] = anything, ... }, true  ) -> nil

Spring.SetTeamColor

 ( number teamID, number r, number g, number b ) -> nil

Spring.AssignMouseCursor default hotspot is center!

 ( string "cmdName", string "iconFileName"
   [, boolean overwrite [, boolean hotSpotTopLeft] ] ) -> nil | boolean

Spring.ReplaceMouseCursor default hotspot is center!

 ( string "oldFileName", string "newFileName" [, boolean hotSpotTopLeft] ) -> nil | boolean

Spring.SetCustomCommandDrawData register your custom cmd so it gets visible in the unit's cmd queue

 ( number cmdID,
   number cmdIconID | string iconname | nil,
   { number r, number g, number b, number a } [, boolean showArea ] ) -> nil | true

[edit] Camera

Spring.SetCameraState

 ( table camState, number camTime) -> nil | boolean

camState = {

 mode = cameraID,
    1 = cameraID,
    2 = posX,
    3 = posY,
    4 = posZ,
    5 = dirX,
    6 = dirY,
    7 = dirZ,
    ... and more (depending on the camera ...

}

Spring.SetCameraTarget

 ( number x, number y, number z [,number transTime] ) -> nil

[edit] World Primitives

outdated! use opengl api instead!

Spring.AddWorldIcon

 ( number cmdID, number x, number y, number z ) -> nil

Spring.AddWorldText

 ( string "text", number x, number y, number z ) -> nil

Spring.AddWorldUnit

 ( number unitDefID,
   number x, number y, number z,
   number team, number facing) -> nil

Retrieved from "http://spring.clan-sy.com/wiki/Lua_UnsyncedCtrl"

This page has been accessed 555 times. This page was last modified 11:00, 15 April 2008.